/*
pcase.cpp : Defines the entry point for the application.
*/

#include <system.h>
#include <wave.h>

static LRESULT WmPaint(HWND hwnd,WPARAM wparam,LPARAM lparam){
    HDC		dc;
    PAINTSTRUCT ps;
    RECT	rc;
    //U32		t,v,*vs,*vx,x0,x1,y0,y1;

    GetClientRect(hwnd,&rc);
    //y1=100;
    //y0=y1+24;
    dc=BeginPaint(hwnd,&ps);
    EndPaint(hwnd,&ps);
    return 0;
}

static LRESULT WmSize(HWND hwnd,WPARAM wparam,LPARAM lparam){
    return 0;
}

static LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam){
    switch(message){
    case WM_PAINT:
	return WmPaint(hwnd,wparam,lparam);
    case WM_SIZE:
	return WmSize(hwnd,wparam,lparam);
    case WM_USER:
	InvalidateRect(hwnd,NULL,TRUE);
	break;
    default:
	return DefWindowProc(hwnd,message,wparam,lparam);
    }
    return 0;
}

//-----------------------------------------------------------------------------

ATOM InitSrch(HINSTANCE hins){
    WNDCLASS	c;

    c.style		=CS_HREDRAW|CS_VREDRAW;
    c.lpfnWndProc	=(WNDPROC)WndProc;
    c.cbClsExtra	=0;
    c.cbWndExtra	=0;
    c.hInstance		=hins;
    c.hIcon		=NULL;
    c.hCursor		=defcursor;
    c.hbrBackground	=(HBRUSH)(COLOR_WINDOW+1);
    c.lpszMenuName	=NULL;
    c.lpszClassName	=cserch;
    return RegisterClass(&c);
}
